package by.grsu.coctails.model.db;

import by.grsu.coctails.constants.ApplicationConstants;
import by.grsu.coctails.model.Ingredient;

public class IngredientDb {

	private Long id;

	private String name;

	private String image;

	private Long ingredientCategoryID;

	private IngredientCategoryDb ingredientCategory;

	private AmountDb amount;

	private IngredientDb(String name, String image) {
		this.name = name;
		this.image = ApplicationConstants.INGREDIETNS_PATH + image;
	}

	public IngredientDb(String name, String image, long ingredientCategoryID,
			Long id) {
		this(name, image);
		this.ingredientCategoryID = ingredientCategoryID;
		this.id = id;
	}

	public IngredientDb(Ingredient ingredient, String count, String amounValue) {
		this(ingredient.getName(), ingredient.getImage(),
				new IngredientCategoryDb(ingredient.getName()), count,
				amounValue);
	}

	public IngredientDb(String name, String image,
			IngredientCategoryDb ingredientCategory, String count,
			String amountValue) {
		this(name, image, ingredientCategory, new AmountDb(count, amountValue));
	}

	public IngredientDb(String name, String image,
			IngredientCategoryDb ingredientCategory, AmountDb amount) {
		this(name, image);
		this.ingredientCategory = ingredientCategory;
		this.amount = amount;
	}

	public String getName() {
		return name;
	}

	public String getImage() {
		return image;
	}

	public Long getIngredientCategoryID() {
		return ingredientCategoryID;
	}

	public void setIngredientCategoryID(Long ingredientCategoryID) {
		this.ingredientCategoryID = ingredientCategoryID;
	}

	public Long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public IngredientCategoryDb getIngredientCategory() {
		return ingredientCategory;
	}

	public AmountDb getAmount() {
		return amount;
	}

}
